DEBUG=yes

CC=gcc

CFLAGS= -g -Wextra  -Wall -pedantic -std=c99 -D_POSIX_SOURCE

ifeq ($(DEBUG), yes)
CFLAGS += -D_DEBUG
endif

LFLAGS=
LIBS=lib/libmk.a

SRC=$(wildcard src/*.c)
INC=$(wildcard heads/*.h)
OBJS=$(SRC:.c=.o)

EXEC=bin/minimake 

.PHONY: all clean mrproper

all : $(EXEC)

$(EXEC) : $(OBJS) $(INC)
	@$(CC) $(OBJS) -o $@ $(LIBS) $(LFLAGS)

%.o:%.c
	@$(CC) -c $< -o $@ $(CFLAGS)

clean :
	@rm $(OBJS)
mrproper :
	@rm $(EXEC)
